﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Alos.Common;
using Alos.Entity;
using Alos.IService;
using System.Configuration;

namespace Alos.LanClass.Api
{
    /// <summary>
    /// 教师行为记录表
    /// </summary>
    public class ReTeacherRecordController : ApiController
    {
        IReTeacherRecordService ReTeacherRecordService;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_IReTeachRecordService"></param>
        public ReTeacherRecordController(IReTeacherRecordService _IReTeacherRecordService)
        {
            ReTeacherRecordService = _IReTeacherRecordService;   
        }
        /// <summary>
        /// 添加教师行为记录
        /// <param name="ReTeacherRecord">教师行为记录</param>
        /// </summary>
        [HttpPost]
        [Route("api/ReTeacherRecord/CreateReTeacherRecord")]
        public JsonRtn<dynamic> CreateReTeacherRecord([FromBody]ReTeacherRecord ReTeacherRecord)
        {
           // string RequestUrl = ConfigurationManager.AppSettings["TeacherRecord"] ?? "192.168.1.99:8733";
            var jsRtn = new JsonRtn<dynamic>();
            jsRtn.message = ReTeacherRecordService.CreateReTeacherRecord(ReTeacherRecord) > 0 ? "添加成功" : "添加失败";
            return jsRtn;
        }
    }
}
